package com.jatosoft.poc.priceinquiry.core.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.TreeSet;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;

@Entity
public final class Article implements Serializable {

	private static final long serialVersionUID = -2360010967289594367L;

	@Transient
	public double getLowestPrice(){
		return 0;
	}
	
	@Transient
	public double getHighestPrice(){
		return 0;
	}
	
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getArticleName() {
		return articleName;
	}

	public void setArticleName(String articleName) {
		this.articleName = articleName;
	}

	public String getArticleUPC() {
		return articleUPC;
	}

	public void setArticleUPC(String articleUPC) {
		this.articleUPC = articleUPC;
	}

	public String getSpecification() {
		return specification;
	}

	public void setSpecification(String specification) {
		this.specification = specification;
	}

	public String getPackageNet() {
		return packageNet;
	}

	public void setPackageNet(String packageNet) {
		this.packageNet = packageNet;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	Long id;
	String articleName;
	String articleUPC;
	String specification;
	String packageNet;
	String brand;
	TreeSet<PriceRecord> priceRecords = new TreeSet<PriceRecord>();
	
}

class PriceRecord{
	Double price;
	Date priceDate;
	String location;
}
